<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%app}}".
 *
 * @property integer $id
 * @property string $name
 * @property string $url
 * @property string $sell_type
 * @property string $key
 * @property integer $supplier_id
 * @property string $type
 * @property string $category_filter
 * @property string $gateway
 * @property integer $enable
 */
class App extends \common\models\AR
{
    const SELL_TYPE_LINGSHOU=1;
    const SELL_TYPE_HUNPI=2;
    const SELL_TYPE_ZHENGXIANG=3;

    const TYPE_LMD=1;
    const TYPE_SUPPLIER=2;
    
    public $modelName='APP';


    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%app}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name','sell_type','type','key','gateway'], 'required'],
            [['sell_type', 'supplier_id', 'type', 'enable'], 'integer'],
            ['supplier_id','default','value'=>0],
            [['category_filter'], 'string'],
            [['name', 'key'], 'string', 'max' => 45],
            [['url', 'gateway'], 'string', 'max' => 100]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '应用名称',
            'url' => '网址',
            'sell_type' => '销售类型',
            'key' => '通信密钥',
            'supplier_id' => '所属供应商',
            'type' => '商城类型',
            'category_filter' => '类目过滤',
            'gateway' => '通信地址',
            'enable' => '启用',
        ];
    }
    

}
